﻿@inherits BaseComponent

<SettingTypeForm Class="kui-setting-form" Model="Context.UserSetting" LabelColSpan="6" OnFinish="OnSave">
    <Title Level="4">@Language["Set.ThemeSetting"]</Title>
    <div class="kui-theme-color">
        @foreach (var item in Colors)
        {
            <div class="item" style="background-color:@(item.Value)" @onclick="e=>OnThemeColor(item.Key)">
                @if (context.ThemeColor == item.Key)
                {
                    <Icon Type="check" />
                }
            </div>
        }
    </div>
    <FormItem Label="@Language["Set.Menu"]">
        <AntRadioGroup @bind-Value="context.MenuTheme" Codes="MenuThemes" OnChange="OnChange" />
    </FormItem>
    <Divider />
    <Title Level="4">@Language["Set.LayoutSetting"]</Title>
    <FormItem Label="@Language["Set.Layout"]">
        <AntRadioGroup @bind-Value="context.LayoutMode" Codes="LayoutModes" OnChange="OnChange" />
    </FormItem>
    <FormItem Label="@Language["Set.Tabs"]">
        <Switch @bind-Checked="context.MultiTab" OnChange="OnChange" />
    </FormItem>
    @if (context.MultiTab)
    {
        <FormItem Label="@Language["Set.TopTab"]">
            <Switch @bind-Checked="context.IsTopTab" OnChange="OnChange" />
        </FormItem>
        <FormItem Label="@Language["Set.MaxTabCount"]">
            <AntInteger @bind-Value="context.MaxTabCount" />
        </FormItem>
    }
    <Divider />
    <Title Level="4">@Language["Set.PreferenceSetting"]</Title>
    <FormItem Label="@Language["Set.Accordion"]">
        <Switch @bind-Checked="context.Accordion" OnChange="OnChange" />
    </FormItem>
    <FormItem Label="表单">
        <AntRadioGroup @bind-Value="context.OpenType" Category="@nameof(FormOpenType)" />
    </FormItem>
    <Title Level="4">@Language["Set.RegionalSetting"]</Title>
    <FormItem Label="@Language["Set.Footer"]">
        <Switch @bind-Checked="context.ShowFooter" OnChange="OnChange" />
    </FormItem>
    <FormItem WrapperColOffset="6" WrapperColSpan="16">
        <Button Type="@ButtonType.Primary" HtmlType="submit">@Language.Save</Button>
        <Button OnClick="OnResetAsync">@Language.Reset</Button>
    </FormItem>
</SettingTypeForm>